// 用于获取url上参数
Request = ({
	// 根据参数名获取参数值
	queryString: function(val) {
		var uri = window.location.search; 
		var re = new RegExp("" +val+ "\=([^\&\?]*)", "ig"); 
		return ((uri.match(re))?(uri.match(re)[0].substr(val.length+1)):null);
	},
	// 获取所有的参数值
	queryStrings : function() {
		var uri = window.location.search;
		var re = /\w*\=([^\&\?]*)/ig;
		var retval = [];
		while ((arr = re.exec(uri)) != null)
			retval.push(arr[0]);
		return retval;
	},
	// 设置参数值
	setQuery : function(val1, val2) { 
		var a = this.QueryStrings();
		var retval = "";
		var seted = false;
		var re = new RegExp("^" + val1 + "\=([^\&\?]*)$", "ig");
		for (var i = 0; i < a.length; i++) {
			if (re.test(a[i])) {
				seted = true;
				a[i] = val1 + "=" + val2;
			}
		}
		retval = a.join("&");
		return "?" + retval + (seted ? "" : (retval ? "&" : "") + val1 + "=" + val2);
	} 
});